<?php
namespace app\supermanager\model;

use think\Model;
use app\common\traits\model\TraitModel;

class Caravans extends Model
{
    use TraitModel;

    protected $table = 'caravan';
	
	protected $type = [
		'piccaravan' => 'array',
		'caravancover' => 'array'
	];
	/**
	 * 房车品牌关联
	 */
	public function carbrands(){
        return $this->belongsTo('CarBrands','car_brands_id');
    }
	
	/**
	 * 房车服务机构关联
	 */
	public function camps(){
        return $this->belongsTo('Camps','services');
    }
	
	/**
	 * 房车会员关联
	 */
	public function users(){
        return $this->belongsTo('Users','user_id');
    }
	
	/**
	 * 车型关联
	 */
	public function carcates(){
        return $this->belongsTo('CarCates','car_cates_id');
    }
	
	/**
	 * 国别关联
	 */
	public function carcountries(){
        return $this->belongsTo('CarCountries','car_countries_id');
    }
	
	public function getZiduna()
    {
        $ziduan=array(
            'kitchen'=>['1'=>'有','2'=>'无'],
            'bathroom'=>['1'=>'有','2'=>'无'], 
            'wifi'=>['1'=>'有','2'=>'无'],
            'tv'=>['1'=>'有','2'=>'无'],
            'washer'=>['1'=>'有','2'=>'无'],
            'air_condition'=>['1'=>'有','2'=>'无'], 
            'the_shower'=>['1'=>'有','2'=>'无'],
            'extinguisher'=>['1'=>'有','2'=>'无'],
            'annunciator'=>['1'=>'有','2'=>'无'],
            'monitored'=>['1'=>'有','2'=>'无'],
             );
         return $ziduan;
    }
	
	/**
	 * 拍档
	 */
	public function speed(){
		return $speed = [1=>'自动挡',2=>'手动挡',3=>'手动一体'];
	} 
	 
	 /**
	 * 准驾类型
	 */
	public function driverType(){
		return $driverType = [1=>'C1',2=>'B1',3=>'B2'];
	} 
	 
	 /**
	  * 获取房车信息
	  */
    public function getCaravansLists($querys = [])
    {
        return $this->getInfoList($querys);
    }


}